#ifndef __WIDGET_H__
#define __WIDGET_H__

#include <stdlib.h>
#include "SDL.h"
#include "device.h"

#ifdef IMGUI_SRC_ID
    #define GEN_ID ((IMGUI_SRC_ID) + (__LINE__))
#else
    #define GEN_ID (__LINE__)
#endif

typedef struct 
{
    int mousex;
    int mousey;
    int mousedown;

    int hotitem;
    int activeitem;

    int kbditem;
    int keyentered;
    int keypressed;

    int show_page;
    int lastwidget;
    int redraw;
    unsigned char next_fb;
} UIState;

int  regionhit  ( int x  , int y , int w , int h );
void label      ( int id , int x , int y , int w , int h , int bgColor , int btnStrings[8]);
int  button     ( int id , int x , int y , int w , int h , int bgColor , int btnStrings[8] , int font);
int  valbtn     ( int id , int x , int y , int w , int h , int bgColor , int btnStrings[8] , int* pvalue);
int  sclbtn     ( int id , int x , int y , int w , int h , int bgColor );
int  tactswitch ( int id , int x , int y , int* pvalue );
int  slider     ( int id , int x , int y , int* pvalue , int max);
void drawBattery(unsigned int x, unsigned int y, unsigned int full);
void drawTime(unsigned int x, unsigned int y, unsigned int bcd_time);
void drawHeat(unsigned int x, unsigned int y, int onheat);

#endif
